<template>
	<view class="pages-index">
		<view class="title-box">
			{{jqjsfrom.name || ''}}
		</view>
		<view class="">
			<!-- <rich-text :nodes="jqjsfrom.text"></rich-text> -->
			 <!-- <div v-html="jqjsfrom.text"></div> -->
			  <u-parse :content="jqjsfrom.text" @preview="preview" @navigate="navigate" ></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		baseOssUrl,
		baseOssUrl2
	} from '@/common/settings';
	import uParse from '@/components/u-parse/u-parse.vue'
	export default {
		 components: {
		    uParse
		  },
		data() {
			return {
				id:'',
				jqjsfrom:{},
				baseOssUrl: baseOssUrl,
				baseOssUrl2:baseOssUrl2,
			}
		},
		onLoad(e) {
			this.id = e.id
			this.jqjsInfo()
		},
		methods: {
			 preview(src, e) {
			      // do something
			    },
			    navigate(href, e) {
			      // do something
			    },
			jqjsInfo() {
				this.$http.get(this.$httpApi.ywglInfo, {
					data: {
						id:this.id
					}
				}).then(res => {
					if (res.code == 0) {
						this.jqjsfrom = res.ywgl
						var richtext= res.ywgl.text;
						const regex = new RegExp('<img', 'gi');
						richtext= this.jqjsfrom.text.replace(regex, `<img style="max-width: 100%;min-width: 702rpx"`)
						this.jqjsfrom.text = richtext;
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import url("@/components/u-parse/u-parse.css");
	.pages-index {
		min-height: 100vh;
		background-color: #ffffff;
		padding: 24rpx;
		.title-box {
			font-size: 43rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #292929;
		}
	}
</style>
